import { fetchData, postData } from '../../api/index';

export default function(){
    let record_url='/api/record'
    let getRecord = async () => {
        try {
            const res = await fetchData(record_url)
            return res
        } catch (error) {

        }
    }
    let queryRecord = async <T>(data:T) => {
        try {
            const res = await postData(record_url+"/query",data)
            return res
        } catch (error) {

        }
    }
    let postRecord = async <T>(data:T) => {
        try {
            const res = await postData(record_url,data);
            return res
        } catch (error) {
       
        }
    }
    return { getRecord,postRecord,queryRecord }
}